/****** Object:  StoredProcedure [dbo].[GetNextId]    Script Date: 02/08/2014 15:46:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[GetNextId](@FieldName varchar(50))
AS
begin
	 declare @NewSeqValue int
	 set @NewSeqValue = (select current_value from dbo.sequence where name = @FieldName)
	 update dbo.sequence set current_value = current_value + increment
	 return @NewSeqValue
end